<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
  <head>
    <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <title>POS Dash | Responsive Bootstrap 4 Admin Dashboard Template</title>
      
      <!-- Favicon -->
      <link rel="shortcut icon" href="/boot/llr/images/favicon.ico" />
      <link rel="stylesheet" href="/boot/llr/css/backend-plugin.min.css">
      <link rel="stylesheet" href="/boot/llr/css/backend.css?v=1.0.0">
      <link rel="stylesheet" href="/boot/llr/vendor/@fortawesome/fontawesome-free/css/all.min.css">
      <link rel="stylesheet" href="/boot/llr/vendor/line-awesome/dist/line-awesome/css/line-awesome.min.css">
      <link rel="stylesheet" href="/boot/llr/vendor/remixicon/fonts/remixicon.css">  </head>
  <body class=" ">
    <!-- loader Start -->
    <div id="loading">
          <div id="loading-center">
          </div>
    </div>
    <!-- loader END -->
    
      <div class="wrapper">
      <section class="login-content">
         <div class="container">
            <div class="row align-items-center justify-content-center height-self-center">
               <div class="col-lg-8">
                  <div class="card auth-card">
                     <div class="card-body p-0">
                        <div class="d-flex align-items-center auth-content">
                           <div class="col-lg-7 align-self-center">
                              <div class="p-3" >
                                 <h2 class="mb-2">登录</h2>



                                 <form role="form" id="register_from" method="post">
                                    <div class="row">
                                       <div class="col-lg-12">
                                          <div class="floating-label form-group">
                                             <input class="floating-input form-control"id="adName" name="adName" type="text" >
                                             <label>用户名</label>
                                          </div>
                                       </div>
                                       <div class="col-lg-12">
                                          <div class="floating-label form-group">
                                             <input class="floating-input form-control" id="adPassword" name="adPassword" type="password" >
                                             <label>密码</label>
                                          </div>
                                       </div>
                                       <div class="col-lg-6">
                                          <div class="custom-control custom-checkbox mb-3">
                                             <input type="checkbox" class="custom-control-input" id="customCheck1">
<%--                                             <label class="custom-control-label control-label-1" for="customCheck1">请记住我</label>--%>
                                          </div>
                                       </div>

                                    </div>
                                    <button type="button" class="btn btn-primary"  id="register_btn">登录</button>
<%--                                    <p class="mt-3">--%>
<%--                                       创建账号 <a href="auth-sign-up.jsp" class="text-primary">注册</a>--%>
<%--                                    </p>--%>
                                 </form>




                              </div>
                           </div>
                           <div class="col-lg-5 content-right">
                              <img src="/boot/llr/images/login/01.png" class="img-fluid image-right" alt="">
                           </div>
                        </div>
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </section>
      </div>
    
    <!-- Backend Bundle JavaScript -->
    <script src="/boot/llr/js/backend-bundle.min.js"></script>
    
    <!-- Table Treeview JavaScript -->
    <script src="/boot/llr/js/table-treeview.js"></script>
    
    <!-- Chart Custom JavaScript -->
    <script src="/boot/llr/js/customizer.js"></script>
    
    <!-- Chart Custom JavaScript -->
    <script async src="/boot/llr/js/chart-custom.js"></script>
    
    <!-- app JavaScript -->
    <script src="/boot/llr/js/app.js"></script>

  <script>
      // function admin(){
      //     window.location = "/boot/user/adminLogin"
      // }
      $(function(){
          $("#register_btn").click(function(){
              $(".cc1").html("");


              let value = $("#register_from").serialize();
              $.post('/boot/user/loginZ',value,function (data){
                  console.log(data);
                  if(data.code=="500")
                  {
                      // alert("数据登录失败");
                      let x = data.data;
                      console.log(x);
                      for(let k in x)
                      {
                          let uname_input =$("#"+k).next().html("<font color='red'>"+x[k]+"</font>");
                      }
                  }

                  if(data.code=="200")
                  {
                      // alert("登录成功");
                      // layui.use('layer', function(){
                      //     var layer = layui.layer;
                      //     layer.msg('登录成功',{icon:6});
                      // });
                      window.location="/boot/user/index1"
                  }
                  if(data.code=="401")
                  {
                      // alert("密码错误，请重新输入");
                      layui.use('layer', function(){
                          var layer = layui.layer;
                          layer.msg('密码错误，请重新输入',{icon:5});
                      });

                  }
                  if(data.code=="402")
                  {
                      // alert("用户错误，请重新输入");
                      layui.use('layer', function(){
                          var layer = layui.layer;
                          layer.msg('用户错误，请重新输入',{icon:5});
                      });
                  }
              });
          });
      })
  </script>
  </body>
</html>